#include "MyNetworkObject.h"


MyNetworkObject::MyNetworkObject(void)
{
	size = 0;
	data = NULL;
}


MyNetworkObject::~MyNetworkObject(void)
{
	if(data != NULL)
	{
		delete []data;
	}
}


MyNetworkObject::MyNetworkObject(const char* c)
{
	size = strlen(c) + 1;
	data = new char[size];
	if(data != NULL)
	{
		memcpy(data,c,size);
	}
}
MyNetworkObject::MyNetworkObject(const MyNetworkObject& _netObject)
{
	size = _netObject.size;
	data = new char[size];
	if(data != NULL)
	{
		memcpy(data,_netObject.data,size);
	}
}

MyNetworkObject& MyNetworkObject::operator = (const MyNetworkObject& _netObject)
{
	size = _netObject.size;
	data = new char[size];
	if(data != NULL)
	{
		memcpy(data,_netObject.data,size);
	}
	return *this;
}